package com.itkm.feignconsumer.controller;

import com.itkm.feignconsumer.service.CommentClientService;
import com.itkm.pojo.Comment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class FeignController {
    @Resource
    private CommentClientService commentClientService;
    @GetMapping("/comment/all")
    public List<Comment> queryCommentList() {
        return commentClientService.getCommentList();
    }

    @GetMapping("/comment/{id}")
    public Comment getCommentById(@PathVariable int id) {
        return commentClientService.getCommentById(id);
    }
}
